package com.example.mall.domain;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.example.mall.util.CodeGenerateUtils;

import java.io.Serializable;

/**
 * <p>
 * 用户登录信息表
 * </p>
 *
 * @author whale
 * @since 2025-05-14
 */
@TableName("tb_user_logins")
public class UserLogins extends Model<UserLogins> {

    private static final long serialVersionUID = 1L;

    /**
     * 唯一标识
     */
    @TableId("login_id")
    private Long loginId;
    /**
     * 用户id
     */
    @TableField("user_id")
    private Long userId;
    /**
     * 用户登陆时间
     */
    @TableField("login_time")
    private Date loginTime;
    /**
     * 用户登录ip地址
     */
    @TableField("login_ip")
    private String loginIp;
    /**
     * 登录状态（0：失败，1：成功）
     */
    @TableField("login_status")
    private Integer loginStatus;
    /**
     * 创建时间
     */
    @TableField("create_date")
    private Date createDate;
    /**
     * 修改时间
     */
    @TableField("update_date")
    private Date updateDate;


    public UserLogins() {
            this.loginId = Long.valueOf(CodeGenerateUtils.generateUniqueId());
    }

    public Long getLoginId() {
        return loginId;
    }

    public void setLoginId(Long loginId) {
        this.loginId = loginId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Date getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(Date loginTime) {
        this.loginTime = loginTime;
    }

    public String getLoginIp() {
        return loginIp;
    }

    public void setLoginIp(String loginIp) {
        this.loginIp = loginIp;
    }

    public Integer getLoginStatus() {
        return loginStatus;
    }

    public void setLoginStatus(Integer loginStatus) {
        this.loginStatus = loginStatus;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    @Override
    public String toString() {
        return "UserLogins{" +
        ", loginId=" + loginId +
        ", userId=" + userId +
        ", loginTime=" + loginTime +
        ", loginIp=" + loginIp +
        ", loginStatus=" + loginStatus +
        ", createDate=" + createDate +
        ", updateDate=" + updateDate +
        "}";
    }
}
